local s15__xiongyi = fk.CreateSkill {
  name = "s15__xiongyi",
  tags = { Skill.Limited },
}
-- local H = require "packages/hegemony/util"
s15__xiongyi:addEffect("active", {
  anim_type = "drawcard",
  card_num = 0,
  target_num = 0,
  can_use = function(self, player)
    return player:usedSkillTimes(s15__xiongyi.name, Player.HistoryGame) == 0
  end,
  -- max_game_use_time = 1,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    local targets = table.filter(room:getAlivePlayers(), function(p) return p:isFriend(player) end)
    for _, p in ipairs(targets) do
      if not p.dead then
        p:drawCards(1, s15__xiongyi.name)
      end
    end
    local targets = table.filter(room.alive_players, function(p)
      return table.every(room.alive_players, function(q)
        return p.hp >= q.hp
      end)
    end)
    local to = room:askToChoosePlayers(player, {
      skill_name = s15__xiongyi.name,
      min_num = 1,
      max_num = 1,
      prompt = "#s15__xiongyi-choose",
      targets = targets,
      cancelable = true,
    })[1]

    if to:isWounded() then
      room:recover({
        who = to,
        num = 1,
        recoverBy = player,
        skillName = s15__xiongyi.name
      })
    end
  end,
})

Fk:loadTranslationTable {
  ["s15__xiongyi"] = "雄异",
  [":s15__xiongyi"] = "限定技，出牌阶段，你可令与你势力相同的所有角色各摸三张牌，然后若你的势力角色数为全场最少，你回复1点体力。",

  ["$s15__xiongyi-choose"] = "你可令一名体力值最低的己方角色回复1点体力",
}

return s15__xiongyi
